package com.zulu.karaoke.database;

public class DatabaseDefinition {
	public static final String CREATE_SQL = "createTable";
	public static final String UPDATE_SQL = "updateTable";

	public static final int DATABASE_VERSION = 1;
	public static final String DATABASE_NAME = "zulukaraoke.db";

	private final static String CREATE_TABLE = "CREATE TABLE ";
//	private final static String T_LONG = " LONG ";
//	private final static String T_DOUBLE = " DOUBLE ";
	private final static String T_INTEGER = " INTEGER ";

	private final static String T_TEXT = " TEXT ";
//	private final static String T_PRIMARY_KEY = " PRIMARY KEY  ";
	private final static String T_PRIMARY_KEY_AUTOINCREMENT = " PRIMARY KEY AUTOINCREMENT ";

	/** tables in dabatase */
	public static final Class<?>[] Tables = { MySongList.class };

//	public static final class MyFavourite {
//		public static final String TABLE = "tbl_favourite";
//		public static final String COLUMN_FAVOURITE_ID = "c_favourite_id";
//		public static final String COLUMN_FAVOURITE_NUMBER = "c_favourite_number";
//		public static final String COLUMN_FAVOURITE_TITLE = "c_favourite_title";
//		public static final String COLUMN_FAVOURITE_BEGIN = "c_favourite_begin";
//
//		/**
//		 * build a sql string to create table shop
//		 */
//		public static String createTable() {
//			return CREATE_TABLE + TABLE + " (" + COLUMN_FAVOURITE_ID
//					+ T_INTEGER + T_PRIMARY_KEY_AUTOINCREMENT + ","
//					+ COLUMN_FAVOURITE_NUMBER + T_TEXT + ","
//					+ COLUMN_FAVOURITE_TITLE + T_TEXT + ","
//					+ COLUMN_FAVOURITE_BEGIN + T_TEXT + ");";
//		}
//
//		/** build sql update table shop */
//		public static String updateTable() {
//			return "DROP TABLE IF EXISTS " + TABLE;
//		}
//	}
	
	public static final class MySongList {
		public static final String TABLE = "tbl_song";
		public static final String COLUMN_SONG_ID = "c_song_id";
		public static final String COLUMN_SONG_NUMBER = "c_song_number";
		public static final String COLUMN_SONG_TITLE = "c_song_title";
		public static final String COLUMN_SONG_BEGIN = "c_song_begin";
		public static final String COLUMN_SONG_FAVOURITE = "c_song_favourite";
		public static final String COLUMN_SONG_COMPOSER = "c_song_composer";
		public static final String COLUMN_SONG_CATEGORY = "c_song_category";
		public static final String COLUMN_SONG_TITLE_SEARCH = "c_song_title_search";
		public static final String COLUMN_SONG_TITLE_FIRST_CHAR = "c_song_title_first_char";
		public static final String COLUMN_SONG_COMPOSER_SEARCH = "c_song_composer_search";
		public static final String COLUMN_SONG_BEGIN_SEARCH = "c_song_begin_search";

		// pass

		/**
		 * build a sql string to create table MySongList
		 */
		public static String createTable() {
			return CREATE_TABLE + TABLE + " (" + COLUMN_SONG_ID
					+ T_INTEGER + T_PRIMARY_KEY_AUTOINCREMENT + ","
					+ COLUMN_SONG_NUMBER + T_TEXT + ","
					+ COLUMN_SONG_TITLE + T_TEXT + ","
					+ COLUMN_SONG_BEGIN + T_TEXT + ","
					+ COLUMN_SONG_FAVOURITE + T_TEXT + ","
					+ COLUMN_SONG_COMPOSER + T_TEXT + ","
					+ COLUMN_SONG_CATEGORY + T_TEXT + ","
					+ COLUMN_SONG_TITLE_SEARCH + T_TEXT + ","
					+ COLUMN_SONG_TITLE_FIRST_CHAR + T_TEXT + ","
					+ COLUMN_SONG_COMPOSER_SEARCH + T_TEXT + ","
					+ COLUMN_SONG_BEGIN_SEARCH + ");";
		}

		/**
		 * build a sql string to update table MySongList
		 */
		public static String updateTable() {
			return "DROP TABLE IF EXISTS " + TABLE;
		}
	}

}

